<%@ page import = "java.util.Hashtable,
                   ro.xblue.translator.LanguageBean,
                   ro.gateway.aida.servlet.*,
                   ro.gateway.aida.obj.*,
                   ro.xblue.translator.TranslatorUtils,
                   ro.gateway.aida.admin.ActivityObjectsOptions,
                   ro.gateway.aida.admin.ActObjsOptsConst" %>

<%@ taglib uri="/WEB-INF/taglib.tld" prefix="gtw" %>

<%@ taglib uri="/WEB-INF/translator.tld" prefix="trans" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

<%@ taglib uri="/WEB-INF/usr.tld" prefix="usr" %>

<%

      Object screen = request.getAttribute(EditActivityServlet.PNAME_SCREEN);

      String key = (String) request.getAttribute(EditActivityServlet.PNAME_KEY);

      if ((request.getAttribute(EditActivityServlet.SIGNATURE) == null) || (key == null)) return;



//      System.err.println("Screen:" + screen);
//
//      System.err.println("Key:" + key);

      Hashtable ed_ctx = (Hashtable) request.getAttribute(EditActivityServlet.PNAME_R_CTX);

      LanguageBean lang_bean = TranslatorUtils.getCurrentLanguage(request, application);

      String lang=lang_bean.language;
String ctx = request.getContextPath();
      Activity bean = (Activity) ed_ctx.get(EditActivityServlet.PNAME_BEAN);



      String title = bean.getTitle(lang_bean.language);

      if (title == null) title = "";



      OrganizationInv[] con_orgs = bean.getOrgsByLRId(OrganizationRole.CONTRACTING_ORG_ROLE);

      if (con_orgs == null) con_orgs = new OrganizationInv[0];

      String org_ids_para = "";

      if (con_orgs.length > 0) {

            StringBuffer sb = new StringBuffer();

            sb.append("&orgids=");

            for (int i = 0; i < con_orgs.length; i++) {

            if (i > 0) sb.append(",");

                  sb.append(con_orgs[i].getOrg_id());

            }

            org_ids_para = sb.toString();

      }



      PersonInv[] con_pers = bean.getPersonsByLRId(OrganizationRole.CONTRACTING_ORG_ROLE);

      if (con_pers == null) con_pers = new PersonInv[0];



      ActivityObjectsOptions aoo = ActivityObjectsOptions.getInstance();



%>

<trans:initPage module="prj_pages" />

<gtw:get_errors/>

<html>

<head>
	<link rel="shortcut icon" href="<html:rewrite page="/images/lpd.png"/>" type="image/ico" />
 <META HTTP-EQUIV="EXPIRES" CONTENT="0"> 
 <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> 
<title>Local Projects Database - Project Editor</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link rel="stylesheet" href="alf.css" type="text/css">

<STYLE>.text_searchbold {

	FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #000000; FONT-STYLE: normal; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif

; text-decoration: none}

.text_search {

	FONT-SIZE: 8pt; FONT-STYLE: normal; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none

}

.text {

	FONT-WEIGHT: normal; FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none

}

.titlu {

	FONT-WEIGHT: bold; FONT-SIZE: 11pt; FONT-STYLE: normal; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none

}

A:hover {

	TEXT-DECORATION: underline

}

</STYLE>

<script language="javascript">

    var ed_con_orgs_win;

    var ed_con_pers_win;

    function open_con_orgs() {

        ed_con_orgs_win = window.open(

        "org/selector.do",
        "ed_con_win", "HEIGHT=400,WIDTH=500,scrollbars=yes");

    };

    function open_con_pers() {

        <% if (con_orgs.length > 0) { %>

        ed_con_pers_win = window.open("pers/selector.do?",

        "ed_con_win", "HEIGHT=400,WIDTH=500,scrollbars=yes");

        <% } else { %>

        alert('<trans:showPageMessage label="p4.err.sconstf" />');

        <% } %>

    };



 function help(pageName) {
        ed_donor_orgs_win = window.open(
        "<%=ctx%>/help/UserGuide.pdf",
        "ed_fin_win", "HEIGHT=500,WIDTH=700");

    };



	function after_org_sel() {

        document.theform.after_selector.value = 'orgs';

        real_submit();

    }

    function after_pers_sel() {

        document.theform.after_selector.value = 'pers';

        real_submit();

    }

    function real_submit() {

        document.theform.action.value = '<%=EditActivityServlet.ACTION_SUBMIT%>';

        document.theform.submit();

    }

</script>

</head>



<body bgcolor="#FFFFFF" text="#000000" topmargin=0 leftmargin=0>

<jsp:include page="header.jsp" />
<br><div align=center class=text_bold><trans:showPageMessage label="p.proiect00" /></div>
  <table width="98%" border="0" cellspacing="1" cellpadding="4" class="text_searchBold" background=images/pixelbgtable.gif align="center">

    <tr>

      <td bgcolor="#FFFFFF" class="text_searchBold" width="30%">

          <table width="100%" cellpadding="0" cellspacing="0" border="0">
               <tr>
                    <td class="text_searchBold" width="10%">
                         <trans:showPageMessage label="p.editor" />
                    </td>
                    <td>
                         <usr:logged_user cellClass="text_search" showLoginLink="false" />
                    </td>
               </tr>
          </table>

      </td>

      <td background=images/pixelbgtable.gif width=35%>

        <div align="center" class="textalb"><trans:showPageMessage label="p.proiect" /></div>

      </td>

      <td bgcolor="#FFFFFF" colspan=2>

        <div align="center"><a href="org/edit" class="text_searchBold"><trans:showPageMessage label="p.organiz" /></a></div>

      </td>
  </tr>

  </table>



  <table width="98%" border="0" cellspacing="1" cellpadding="5" background=images/pixelbgtable.gif align=center>

    <tr bgcolor="#FFFFFF">

      <td align="center" width="75%" class="textalb" background=images/pixelbgtable.gif>

<trans:showPageMessage label="p.page4" />

      </td>

      <td width="25%" class="text_searchBold" background=images/pixelbgtable.gif>&nbsp;



      </td>

    </tr>

<form name="theform" method="post" action="editActivity">

<input type="hidden" name="prj_jump" value="" />
<input type="hidden" name="action" value="<%=EditActivityServlet.ACTION_SUBMIT%>" />

<input type="hidden" name="key" value="<%=key%>" />

<input type="hidden" name="page" value="4" />

<input type="hidden" name="after_selector" value="" />

<input type="hidden" name="preview_data" value="false" />

    <tr bgcolor="#FFFFFF">

      <td width="75%" bgcolor="f9f9f9" class="text_search">



      <% if (aoo.isEnabled(ActObjsOptsConst.CONTRACTING_ORGS)) { %>

            <gtw:show_error label='<%=ActObjsOptsConst.CONTRACTING_ORGS%>' />

        <br>

        <p><img src=images/arrow_blue.gif hspace=4><b><trans:showPageMessage label="md.cauth" />

        <%=(aoo.isMandatory(ActObjsOptsConst.CONTRACTING_ORGS)) ? "(<font color=red>*</font>)" : ""%>

        </b> </p>

        <div align="center">

        <table width="80%" cellpadding="5" border="0" cellspacing="1" background=images/pixelbgtable.gif>

          <tr>

            <td class="text_searchbold" bgcolor="#FFFFFF"><trans:showPageMessage label="p4.listcauth" /></td>

          </tr>

          <tr>

            <td class="text_search" bgcolor="#FFFFFF">

              <% if (con_orgs.length == 0) { %>

              <trans:showPageMessage label="p4.nocauth" />

              <% } else { %>

              <% for (int i = 0; i < con_orgs.length; i++) { %>

              <input type="checkbox" name="conorg_id" value="<%=con_orgs[i].getOrg_id()%>" />

             <a href=# onclick="javascript:window.open('org/view?id=<%=con_orgs[i].getOrg().getId()%>', 'org_viewer', 'status=yes,WIDTH=400,HEIGHT=400,scrollbars=YES');">

              <%=con_orgs[i].getOrg().getName()%></a><br>

              <% } %>

              <% } %>

            </td>

          </tr>

          <tr>

            <td bgcolor="#FFFFFF">

              <input onClick="javascript:open_con_orgs();" class="buton" type="button" value="<trans:showPageMessage label="p4.edcauth" hide_link="true" />"/>

                  <% if (con_orgs.length > 0) { %>

                  <input type="button" name="remove_contr_orgs" class="buton" value="<trans:showPageMessage label="p.remove_contr_orgs" hide_link="true" />"

                  onclick="javascript:document.theform.action.value='remove_contr_orgs';document.theform.submit();">

                  <% } %>

            </td>

          </tr>

        </table>

        </div>

        <% } %>



        <% if (aoo.isEnabled(ActObjsOptsConst.CONTRACTING_PERS)) { %>

            <gtw:show_error label='<%=ActObjsOptsConst.CONTRACTING_PERS%>' />

        <p><b><trans:showPageMessage label="p4.labelpers" /></b> </p>

        <div align="center">

        <table width="80%" cellpadding="5" border="0" cellspacing="1" background=images/pixelbgtable.gif>

          <tr>

            <td class="text_searchbold" bgcolor="#FFFFFF"><trans:showPageMessage label="p4.listpers" />

            <%=aoo.isMandatory(ActObjsOptsConst.CONTRACTING_PERS) ? "(<font color=red>*</font>)" : ""%>

            </td>

        </tr>

        <tr>

            <td class="text_search" bgcolor="#FFFFFF">

              <% if (con_pers.length == 0) { %>

              <trans:showPageMessage label="p4.nopers" />

              <% } else { %>

              <% for (int i = 0; i < con_pers.length; i++) { %>

              <input type="checkbox" name="conpers_id" value="<%=con_pers[i].getPerson_id()%>" />

               <a href=# onclick="javascript:window.open('pers/view?id=<%=con_pers[i].getPerson().getId()%>', 'pers_viewer', 'status=yes,WIDTH=400,HEIGHT=400,SCROLLBARS=yes');">

              <%=con_pers[i].getPerson().getName()%></a><br>

            <% } %>

            <% } %>

            </td>

        </tr>

        <tr>

            <td bgcolor="#FFFFFF">

                  <input onClick="javascript:open_con_pers();" class="buton" type="button" value="<trans:showPageMessage label="p4.edpers" hide_link="true" />" />

                  <% if (con_pers.length > 0) { %>

                  <input type="button" name="remove_contr_pers" class="buton" value="<trans:showPageMessage label="p.remove_contr_pers"  hide_link="true" />"

                  onclick="javascript:document.theform.action.value='remove_contr_pers';document.theform.submit();">

                  <% } %>

            </td>

        </tr>

        </table>

        </div>

        <% } %>

		<trans:showPageMessage label="translator.showhiddentags"/>

        <br><br>

        <div align="center">

        <input type="button" name="un_nume" value="<trans:showPageMessage label="p.sinfo" hide_link="true" />" onClick="javascript:document.theform.action.value='<%=EditActivityServlet.ACTION_SUBMIT%>';document.theform.submit();" class="butonsave"/>

        </div>



      </td>

      <td width="25%" valign="top">

<!-- meniu dreapta -->

<table width="98%" border="0" cellspacing="1" cellpadding="2" bgcolor="#000066">

<tr>

	      <td bgcolor="#000066" align="center"><b> <span class="textalb"><trans:showPageMessage label="p.proj" />:</span>

            <span class="textalb"><font color="#F9E031"><%=title%></font></span></b></td>

</tr>

<tr>
	<td background=images/pixelbgtable.gif class="textalb">
		<img src=images/arrow_white_tr.gif>
		<a
            onclick="javascript:theform.prj_jump.value='1';theform.submit();"
            style="cursor:hand;"
            class="textalb"><trans:showPageMessage label="md.identif" /></a>
	</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='1';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.plan" /></a>
</td>
</tr>

<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='2';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.loc" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='2';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.sec" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='2';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.comp" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='3';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.fin" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='3';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.prel" /></a>
</td>
</tr>



<tr>

          <td bgcolor="#336699" class="textalb"> <img src=images/arrow_white_tr.gif>

            <a href="editActivity?key=<%=key%>&page=4" class="textalb"><trans:showPageMessage label="md.cauth" /></a>

          </td>

</tr>

<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='5';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.ben" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='5';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.descobj" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='6';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.docl" /></a>
</td>
</tr>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='6';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="md.pinv" /></a>
</td>
</tr>
<% if (aoo.isEnabled(ActObjsOptsConst.NOTEFIELDS)) { %>
<tr>
<td background=images/pixelbgtable.gif class="textalb">
	<img src=images/arrow_white_tr.gif>
	<a
      onclick="javascript:theform.prj_jump.value='7';theform.submit();"
      style="cursor:hand;"
      class="textalb"><trans:showPageMessage label="p.notefields" /></a>
</td>
</tr>
<% } %>
<tr>

          <td background=images/pixelbgtable.gif align="center">

            <input type="button" name="Help" class="buton" value="<trans:showPageMessage label="p.help" hide_link="true" />"

          onClick="javascript:help('aboutPage4.htm');">

          </td>

</tr>

<tr>

<td background=images/pixelbgtable.gif height="45">

<div align="center">

<input	type="button" onclick="javascript:document.theform.action.value='<%=EditActivityServlet.ACTION_SUBMIT%>';document.theform.preview_data.value='true';document.theform.submit();"

	value='<trans:showPageMessage label="p.pubinfo" hide_link="true" />'

	class="butonpublish"

/>
<trans:showPageMessage label="translator.showhiddentags"/>
</div>

</td>

</tr>

</table>

<!-- ziendof meniu dreapta -->

      </td>

    </tr>

  </table>

</form>



<script language="javascript">

function chlang(dd) {

if(dd.options[dd.selectedIndex].value == 'ro') window.location='/editActivity?lang=ro';

if(dd.options[dd.selectedIndex].value == 'us') window.location='/editActivity?lang=us';

}

</script>

<jsp:include page="footer.jsp" />

</body>
 <HEAD> 
 <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> 
 </HEAD> 
</html>

<!--

-->

